package view;

import model.Viewport;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.UnicodeFont;
import org.newdawn.slick.state.StateBasedGame;
import org.newdawn.slick.state.transition.EmptyTransition;
import org.newdawn.slick.state.transition.FadeInTransition;
import org.newdawn.slick.state.transition.FadeOutTransition;
import org.newdawn.slick.state.transition.Transition;

public class MisterJumpMain  extends StateBasedGame{
    public static final int MAINMENUSTATE          = 0;
    public static final int GAMEPLAYSTATE          = 1;
    public static final int OPTIONSTATE			   = 2;
    public static final int CREDITSTATE			   = 3;
	public static final int PAUSEGAMESTATE 		   = 5;
	public static final int GAMEOVERSTATE		   = 6;
    
    public MisterJumpMain() {
    	super("MisterJump");
    	this.addState(new MisterJumpMenu(MAINMENUSTATE));
    	this.addState(new MisterJumpGameplay(GAMEPLAYSTATE));
    	this.addState(new MisterJumpCreditsMenu(CREDITSTATE));
    	this.addState(new MisterJumpGameover(GAMEOVERSTATE));
    	this.enterState(MAINMENUSTATE,new EmptyTransition(), new FadeInTransition());
	}
    
    @Override
    public void initStatesList(GameContainer gameContainer) throws SlickException {
        this.getState(MAINMENUSTATE).init(gameContainer, this);
        this.getState(GAMEPLAYSTATE).init(gameContainer, this);
        this.getState(CREDITSTATE).init(gameContainer, this);
        this.getState(GAMEOVERSTATE).init(gameContainer, this);
    }
    
    public static void main(String[] args) throws SlickException{
        AppGameContainer app = new AppGameContainer(new MisterJumpMain());
        app.setDisplayMode(Viewport.WIDTH, Viewport.HEIGHT, false);
        app.setVSync(true);
        app.setShowFPS(true);
        app.start();
	}
}
